Repository navigation
fix(ci): compile scope globs exactly as the engine does - #1888
Merged
mergify[bot] merged 1 commit intoOct 6, 2026
Conversation
Contributor
Merge Protections🟢 All 6 merge protections satisfied — ready to merge. Show 6 satisfied protections🟢 🤖 Continuous Integration
🟢 👀 Review Requirements
🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 Reviews
🟢 📕 PR description
🟢 🚦 Auto-queueWhen all merge protections are satisfied, this pull request will be queued automatically. |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The cross-language compiler controls CI job selection, so its engine-parity guarantees warrant final human validation.
Review effort: Balanced
Findings: None
What changed in this PR
Aligns mergify ci scopes glob matching with the engine so CI and the merge queue select files consistently.
Changes:
- Replaces globset with a compiler supporting engine brace, separator, and Unicode semantics, with explicit POSIX-class rejection.
- Adds engine-generated parity fixtures and a regeneration script.
| File | Description |
|---|---|
| crates/mergify-ci/src/scopes_detect/mod.rs | Registers the compiler module. |
| crates/mergify-ci/src/scopes_detect/matching.rs | Integrates regex matching and compiler errors. |
| crates/mergify-ci/src/scopes_detect/engine_glob.rs | Implements engine-compatible translation and parity tests. |
| crates/mergify-ci/src/scopes_detect/engine_glob_cases.py | Generates expected engine verdicts. |
| crates/mergify-ci/src/scopes_detect/engine_glob_cases.json | Records matching and rejection cases. |
| crates/mergify-ci/src/scopes_detect/changed_files.rs | Updates Unicode-matching documentation only. |
| crates/mergify-ci/Cargo.toml | Replaces globset with regex. |
| Cargo.toml | Removes the workspace globset dependency. |
| Cargo.lock | Updates dependencies accordingly. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
`mergify ci scopes` matched scope globs with globset, the engine with its own brace expansion plus Python's `glob.translate`. Even with `*` bounded and `?` matching characters, the two dialects still disagreed on ASCII patterns, so one config could select different files in CI and in the merge queue: - `[^x]` negated in globset, it is a class holding `^` and `x` for the engine; - a class spanning a separator (`x[a/b]y`) was a class in globset, the engine splits the pattern on separators first, so it is literal text; - `\` was an escape in globset, it is a path separator for the engine. Replace globset with `engine_glob`, a port of the engine's `globs.expand_braces` and of `glob.translate(recursive=True, include_hidden=True, seps=["/", "\\"])`, emitting a `regex` crate pattern. `engine_glob_cases.json` holds patterns and paths with the verdicts the engine itself gives, generated by `engine_glob_cases.py` from the engine's `globs.py` on Python 3.14 with the `regex` module, and a test checks this side reproduces every one. A local run of the same comparison over ~190,000 random pattern/path pairs found no other difference. The one deliberate divergence: the `regex` module reads `[:name:]` inside a set as a POSIX class, which swallows the glob class's closing bracket. The engine then rejects the pattern or matches something meaningless; the CLI refuses it as a configuration error. A regex that fails to compile is a bug in the port, so it is reported as such rather than as the user's config. This also matches `?` and `[...]` per character on non-ASCII paths, which #1883 (MRGFY-10066) did on top of globset; that pull request is closed in favour of this one. Fixes MRGFY-10075 Fixes MRGFY-10066 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Change-Id: I67724907949c50cfc3f10f37dd968cc2e68dab2e
sileht
force-pushed
the
devs/sileht/mrgfy-10075-scopes-glob-port/compile-scope-globs-exactly-engine--67724907
branch
from
October 6, 2026 05:50
706de25 to
a639e45
Compare
Member
Author
Revision history
|
jd
approved these changes
Oct 6, 2026
kozlek
approved these changes
Oct 6, 2026
Contributor
Merge Queue Status
This pull request spent 11 seconds in the queue, including 1 second running CI. Required conditions to merge
|
mergify
Bot
deleted the
devs/sileht/mrgfy-10075-scopes-glob-port/compile-scope-globs-exactly-engine--67724907
branch
October 6, 2026 07:39
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mergify ci scopesmatched scope globs with globset, the engine withits own brace expansion plus Python's
glob.translate. Even with*bounded and
?matching characters, the two dialects still disagreed onASCII patterns, so one config could select different files in CI and in
the merge queue:
[^x]negated in globset, it is a class holding^andxfor theengine;
x[a/b]y) was a class in globset, theengine splits the pattern on separators first, so it is literal text;
\was an escape in globset, it is a path separator for the engine.Replace globset with
engine_glob, a port of the engine'sglobs.expand_bracesand ofglob.translate(recursive=True, include_hidden=True, seps=["/", "\\"]), emitting aregexcratepattern.
engine_glob_cases.jsonholds patterns and paths with theverdicts the engine itself gives, generated by
engine_glob_cases.pyfrom the engine's
globs.pyon Python 3.14 with theregexmodule,and a test checks this side reproduces every one. A local run of the
same comparison over ~190,000 random pattern/path pairs found no other
difference.
The one deliberate divergence: the
regexmodule reads[:name:]inside a set as a POSIX class, which swallows the glob class's closing
bracket. The engine then rejects the pattern or matches something
meaningless; the CLI refuses it as a configuration error. A regex that
fails to compile is a bug in the port, so it is reported as such rather
than as the user's config.
This also matches
?and[...]per character on non-ASCII paths,which #1883 (MRGFY-10066)
did on top of globset; that pull request is closed in favour of this one.
Fixes MRGFY-10075
Fixes MRGFY-10066
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com